﻿using Abp.Domain.Entities.Auditing;
using SingleUserMall.Items;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SingleUserMall.Orders
{
    /// <summary>
    /// 订单元素
    /// </summary>
    public class OrderDetail : FullAuditedEntity<long>
    {
        /// <summary>
        /// 订单id
        /// </summary>
        public long OrderId { get; set; }
        [ForeignKey("OrderId")]
        public virtual Order Order { get; set; }
        /// <summary>
        /// 商品规格id
        /// </summary>
        public long ItemSpecId { get; set; }
        [ForeignKey("ItemSpecId")]
        public virtual ItemSpec ItemSpec { get; set; }
        /// <summary>
        /// 价格
        /// </summary>
        public decimal Price { get; set; }
        /// <summary>
        /// 包装费
        /// </summary>
        public decimal PackPrice { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public int Qty { get; set; }
        /// <summary>
        /// 运费
        /// </summary>
        public decimal Freight { get; set; }

        /// <summary>
        /// 每天分红收益
        /// </summary>
        public decimal? DailyProfit { get; set; }

        /// <summary>
        /// 已分红天数
        /// </summary>
        public int? DividendDay { get; set; }

        /// <summary>
        /// 累计分红收益
        /// </summary>
        public decimal? Profit { get; set; }
        /// <summary>
        /// 是否退款
        /// </summary>
        public bool IsRefund { get; set; }

        /// <summary>
        /// 是否开始分红
        /// </summary>
        public bool IsProfitStart { get; set; }
        /// <summary>
        /// 分红时间
        /// </summary>
        public DateTime? ProfitDateTime { get; set; }
    }
}
